<?
// creating previous and next link
// plus the link to go straight to
// the first and last page
if($pagenav['maxPage'])
{
	if ($pagenav['pageNum'] > 1)
	{
		$page  = $pagenav['pageNum'] - 1;
		$prev  = " <a href='" . $pagenav['url'] . "&ind=" . $page . "'>[Anterior]</a> ";

		$first = " <a href='" . $pagenav['url'] . "&ind=1'>[Primeira Página]</a> ";
	} else {
		$prev  = '&nbsp;'; // we're on page one, don't print previous link
		$first = '&nbsp;'; // nor the first page link
	}

	if ($pagenav['pageNum'] < $pagenav['maxPage'])
	{
		$page = $pagenav['pageNum'] + 1;
		$next = " <a href='" . $pagenav['url'] . "&ind=" . $page . "'>[Próxima]</a> ";

   		$last = " <a href='" . $pagenav['url'] . "&ind=" . $pagenav['maxPage'] . "'>[Última Página]</a> ";
	} else {
		$next = '&nbsp;'; // we're on the last page, don't print next link
		$last = '&nbsp;'; // nor the last page link
	}

	// print the navigation link
	echo $first . $prev . " Página " . $pagenav['pageNum'] . " de " . $pagenav['maxPage'] . " páginas " . $next . $last;
} else {
	echo "Não foram encontrados resultados";
}
?>